package com.autumn.oauth2.zero.domain.entities;

import javax.persistence.Column;

import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.StringTypeHandler;

import com.autumn.domain.entities.auditing.AbstractDefaultFullGmtEntity;
import com.autumn.mybatis.mapper.annotation.ColumnOrder;
import com.autumn.mybatis.mapper.annotation.ColumnType;
import com.autumn.mybatis.mapper.annotation.Index;

/**
 * 角色抽象
 * 
 * @author 老码农 2018-04-09 22:32:48
 */
public abstract class AbstractRole extends AbstractDefaultFullGmtEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7407567953353143107L;

	@ColumnOrder(1)
	@Column(name = "name", length = 100, nullable = false)
	@Index
	private String name;
	@ColumnOrder(10)
	@Column(name = "is_enabled", nullable = false)
	private boolean isEnabled;
	@ColumnOrder(100)
	@Column(name = "remark", nullable = false)
	@ColumnType(jdbcType = JdbcType.BLOB, typeHandlerClass = StringTypeHandler.class)
	private String remark;

	public AbstractRole() {
		this.setEnabled(true);
	}

	/**
	 * 获取角色名称
	 * 
	 * @return
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * 设置角色名称
	 * 
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * 获取是否启用
	 * 
	 * @return
	 */
	public boolean isEnabled() {
		return this.isEnabled;
	}

	/**
	 * 设置是否启用
	 * 
	 * @param isEnabled
	 */
	public void setEnabled(boolean isEnabled) {
		this.isEnabled = isEnabled;
	}

	/**
	 * 获取备注
	 * 
	 * @return
	 */
	public String getRemark() {
		return remark;
	}

	/**
	 * 设置备注
	 * 
	 * @param remark
	 *            备注
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}
}
